package com.yide.myworld.handler;

import com.yide.myworld.exception.Asserts;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.client.producer.SendCallback;
import org.apache.rocketmq.client.producer.SendResult;

/**
 * @auth: byebyebye
 * @description:
 */
@Slf4j
public class RocketSendCallBackHandler implements SendCallback {

    @Override
    public void onSuccess(SendResult sendResult) {
        log.info("发送成功：{}", sendResult);
    }

    @Override
    public void onException(Throwable throwable) {
        log.info("发送失败：{}", throwable.getMessage());
        Asserts.fail(throwable.getMessage());
    }
}
